home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / SV_SRALY.ZIP / Sega Rally.txt < prev   
Encoding:
Text File  |  1998-04-24  |  15.7 KB  |  318 lines

  1.  
  2. Free Information Xchange '98 presents:
  3.  
  4. Sega Rally - CD crack by Static Vengeace
  5.  
  6. Requirements:
  7. hex editor and full install
  8.  
  9.     Here we go again, another tutorial based on a Sega game.  Sega Rally Championship racing is
  10. alright but needs a Direct3D (or a 3Dfx) patch for more realism and better frame rates.  That would be
  11. nice but, I can live with the recently released MMX enhanced version 2.1 (from the www.sega.com) of the
  12. game.  However, there is one thing I cannot live with and that's the CD check that occurs when I run the
  13. game.  So of course I set out to FiX this minor problem.  Then I thought, as long as I know how to crack
  14. it, I would show you how to do it too.  To begin, like the other tutorials on CD checks cracking I have
  15. done, I will be using W32Dasm (URSoft) to disassemble and trace through this one.  So if you would like to
  16. follow along you will need to use W32Dasm and disasseble rally.exe.  Although the code listing is from the
  17. newer version 2.1, simular steps will work for the version that's on the CD.  In fact, I have also included
  18. the needed edit for both versions at the end of this article.
  19.     Using my favorite method: Go up to the menu bar and select "Refs" and then select "String data
  20. references" from the drop down menu.  From there, grab the slider bar and scroll down checking for strings
  21. like "Insert..." or "Please insert.." and eventually you'll run across "Please insert Sega Rally CD."  So
  22. let's double click on that string (this will put you in the middle of the routine that checks for the CD)
  23. and see what we have:
  24.  
  25. * Referenced by a CALL at Addresses:
  26. |:004D894C   , :004D8C21                                          <-- Where the calls came from
  27. |
  28. :004F7CA0 81EC04020000            sub esp, 00000204
  29. :004F7CA6 53                      push ebx
  30. :004F7CA7 56                      push esi
  31. :004F7CA8 57                      push edi
  32. :004F7CA9 55                      push ebp
  33.  
  34. * Reference To: KERNEL32.lstrcatA, Ord:0292h
  35.                                   |
  36. :004F7CAA 8B2D60541001            mov ebp, dword ptr [01105460]
  37.  
  38. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  39. |:004F7DD4(C)
  40. |
  41. :004F7CB0 33DB                    xor ebx, ebx            <-- Initialize number of times tries allowed
  42.  
  43. * Reference To: KERNEL32.GetLogicalDrives, Ord:00FAh               <-- Doesn't this line stand out?
  44.                                   |
  45. :004F7CB2 FF155C541001            Call dword ptr [0110545C]
  46. :004F7CB8 89442410                mov dword ptr [esp+10], eax
  47.  
  48. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  49. |:004F7D97(C)
  50. |
  51. :004F7CBC B801000000              mov eax, 00000001
  52. :004F7CC1 8ACB                    mov cl, bl
  53. :004F7CC3 D3E0                    shl eax, cl
  54. :004F7CC5 85442410                test dword ptr [esp+10], eax
  55. :004F7CC9 0F84C4000000            je 004F7D93
  56. :004F7CCF 8D4341                  lea eax, dword ptr [ebx+41]
  57. :004F7CD2 8D8C2414010000          lea ecx, dword ptr [esp+00000114]
  58. :004F7CD9 50                      push eax
  59.  
  60. * Possible StringData Ref from Data Obj ->"%c:\"             <-- Another common ref string in CD checks
  61.                                   |
  62. :004F7CDA 6808916500              push 00659108
  63. :004F7CDF 51                      push ecx
  64.  
  65. * Reference To: USER32.wsprintfA, Ord:026Dh
  66.                                   |
  67. :004F7CE0 FF157C551001            Call dword ptr [0110557C]
  68. :004F7CE6 8D8C2420010000          lea ecx, dword ptr [esp+00000120]
  69. :004F7CED 83C40C                  add esp, 0000000C
  70. :004F7CF0 51                      push ecx
  71.  
  72. * Reference To: KERNEL32.GetDriveTypeA, Ord:00DFh            <-- Common text string to search for
  73.                                   |
  74. :004F7CF1 FF1564541001            Call dword ptr [01105464]
  75. :004F7CF7 83F805                  cmp eax, 00000005          <-- Value for CD-ROM drives
  76. :004F7CFA 0F8593000000            jne 004F7D93
  77. :004F7D00 8DBC2414010000          lea edi, dword ptr [esp+00000114]
  78. :004F7D07 B9FFFFFFFF              mov ecx, FFFFFFFF
  79. :004F7D0C 2BC0                    sub eax, eax
  80.  
  81. * Possible StringData Ref from Data Obj ->"srally\rally.exe"        <-- The file we check for
  82.                                   |
  83. :004F7D0E 6810916500              push 00659110
  84. :004F7D13 F2                      repnz
  85. :004F7D14 AE                      scasb
  86. :004F7D15 F7D1                    not ecx
  87. :004F7D17 2BF9                    sub edi, ecx
  88. :004F7D19 8BC1                    mov eax, ecx
  89. :004F7D1B C1E902                  shr ecx, 02
  90. :004F7D1E 8BF7                    mov esi, edi
  91. :004F7D20 8D7C2418                lea edi, dword ptr [esp+18]
  92. :004F7D24 F3                      repz
  93. :004F7D25 A5                      movsd
  94. :004F7D26 8BC8                    mov ecx, eax
  95. :004F7D28 83E103                  and ecx, 00000003
  96. :004F7D2B F3                      repz
  97. :004F7D2C A4                      movsb
  98. :004F7D2D 8D4C2418                lea ecx, dword ptr [esp+18]
  99. :004F7D31 51                      push ecx
  100. :004F7D32 FFD5                    call ebp
  101. :004F7D34 8D442414                lea eax, dword ptr [esp+14]
  102. :004F7D38 6A00                    push 00000000
  103. :004F7D3A 50                      push eax
  104.  
  105. * Reference To: KERNEL32._lopen, Ord:028Eh
  106.                                   |
  107. :004F7D3B FF1568541001            Call dword ptr [01105468]
  108. :004F7D41 83F8FF                  cmp eax, FFFFFFFF
  109. :004F7D44 744D                    je 004F7D93
  110. :004F7D46 50                      push eax
  111.  
  112. * Reference To: KERNEL32._lclose, Ord:028Bh
  113.                                   |
  114. :004F7D47 FF157C541001            Call dword ptr [0110547C]
  115. :004F7D4D 8DBC2414010000          lea edi, dword ptr [esp+00000114]
  116. :004F7D54 B9FFFFFFFF              mov ecx, FFFFFFFF
  117. :004F7D59 2BC0                    sub eax, eax
  118.  
  119. * Possible StringData Ref from Data Obj ->"srally\lake.tex"  <-- Check for this one also
  120.                                   |
  121. :004F7D5B 6824916500              push 00659124
  122. :004F7D60 F2                      repnz
  123. :004F7D61 AE                      scasb
  124. :004F7D62 F7D1                    not ecx
  125. :004F7D64 2BF9                    sub edi, ecx
  126. :004F7D66 8BC1                    mov eax, ecx
  127. :004F7D68 C1E902                  shr ecx, 02
  128. :004F7D6B 8BF7                    mov esi, edi
  129. :004F7D6D 8D7C2418                lea edi, dword ptr [esp+18]
  130. :004F7D71 F3                      repz
  131. :004F7D72 A5                      movsd
  132. :004F7D73 8BC8                    mov ecx, eax
  133. :004F7D75 83E103                  and ecx, 00000003
  134. :004F7D78 F3                      repz
  135. :004F7D79 A4                      movsb
  136. :004F7D7A 8D4C2418                lea ecx, dword ptr [esp+18]
  137. :004F7D7E 51                      push ecx
  138. :004F7D7F FFD5                    call ebp
  139. :004F7D81 8D442414                lea eax, dword ptr [esp+14]
  140. :004F7D85 6A00                    push 00000000
  141. :004F7D87 50                      push eax
  142.  
  143. * Reference To: KERNEL32._lopen, Ord:028Eh
  144.                                   |
  145. :004F7D88 FF1568541001            Call dword ptr [01105468]
  146. :004F7D8E 83F8FF                  cmp eax, FFFFFFFF
  147. :004F7D91 750C                    jne 004F7D9F
  148.  
  149. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  150. |:004F7CC9(C), :004F7CFA(C), :004F7D44(C)
  151. |
  152. :004F7D93 43                      inc ebx               <-- Increase the number of times we tried so far
  153. :004F7D94 83FB20                  cmp ebx, 00000020     <-- We'll try 32 times to check for the file
  154. :004F7D97 0F8C1FFFFFFF            jl 004F7CBC           <-- Loop back up and try again
  155. :004F7D9D EB07                    jmp 004F7DA6          <-- Tried all 32 times and STILL no CD
  156.  
  157. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  158. |:004F7D91(C)
  159. |
  160. :004F7D9F 50                      push eax
  161.  
  162. * Reference To: KERNEL32._lclose, Ord:028Bh
  163.                                   |
  164. :004F7DA0 FF157C541001            Call dword ptr [0110547C]
  165.  
  166. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  167. |:004F7D9D(U)
  168. |
  169. :004F7DA6 B8FFFFFFFF              mov eax, FFFFFFFF    <-- Load eax for a failed CD check
  170. :004F7DAB 83FB20                  cmp ebx, 00000020    <-- Did we use all 32 tries
  171. :004F7DAE 7402                    je 004F7DB2          <-- If yes, then leave FFFFFFFF in eax
  172. :004F7DB0 8BC3                    mov eax, ebx         <-- Any other value in eax = passed CD check
  173.  
  174. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  175. |:004F7DAE(C)
  176. |
  177. :004F7DB2 A39C646500              mov dword ptr [0065649C], eax
  178. :004F7DB7 83F8FF                  cmp eax, FFFFFFFF                <-- Was the check good or bad?
  179. :004F7DBA 752B                    jne 004F7DE7                     <-- Take this jump for CD check=passed
  180. :004F7DBC 6A35                    push 00000035
  181.  
  182. * Possible StringData Ref from Data Obj ->"SEGA RALLY CHAMPIONSHIP for PC"
  183.                                   |
  184. :004F7DBE A170646500              mov eax, dword ptr [00656470]
  185. :004F7DC3 50                      push eax
  186.  
  187. * Possible StringData Ref from Data Obj ->"Please insert Sega Rally CD."  <-- The string we don't want
  188.                                   |                                       <-- to ever see..
  189. :004F7DC4 6834916500              push 00659134
  190. :004F7DC9 6A00                    push 00000000
  191.  
  192. * Reference To: USER32.MessageBoxA, Ord:019Bh
  193.                                   |
  194. :004F7DCB FF15EC551001            Call dword ptr [011055EC]
  195. :004F7DD1 83F802                  cmp eax, 00000002           <-- 02 means "we" pressed cancel
  196. :004F7DD4 0F85D6FEFFFF            jne 004F7CB0                <-- This jump loops back up to recheck
  197. :004F7DDA 33C0                    xor eax, eax                <-- Set eax to zero for failed CD check
  198. :004F7DDC 5D                      pop ebp
  199. :004F7DDD 5F                      pop edi
  200. :004F7DDE 5E                      pop esi
  201. :004F7DDF 5B                      pop ebx
  202. :004F7DE0 81C404020000            add esp, 00000204
  203. :004F7DE6 C3                      ret
  204.  
  205. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  206. |:004F7DBA(C)
  207. |
  208. :004F7DE7 B801000000              mov eax, 00000001      <-- Load eax with 01 for a passed CD check
  209. :004F7DEC 5D                      pop ebp
  210. :004F7DED 5F                      pop edi
  211. :004F7DEE 5E                      pop esi
  212. :004F7DEF 5B                      pop ebx
  213. :004F7DF0 81C404020000            add esp, 00000204
  214. :004F7DF6 C3                      ret
  215.  
  216.     That seems straight forward when you take into acount the couple of comments
  217. I made as to what's going on.  So lets check the code that calls the above routine.
  218. First comes the code from 4D894C:
  219.  
  220. :004D8943 A1C0646500              mov eax, dword ptr [006564C0]
  221. :004D8948 A804                    test al, 04
  222. :004D894A 7515                    jne 004D8961
  223. :004D894C E84FF30100              call 004F7CA0        <-- Call the CD check routine
  224. :004D8951 85C0                    test eax, eax        <-- Check to see what came back in eax
  225. :004D8953 750C                    jne 004D8961         <-- Take this jump for good CD check
  226. :004D8955 33C0                    xor eax, eax         <-- Zero out eax
  227. :004D8957 5D                      pop ebp
  228. :004D8958 5F                      pop edi
  229. :004D8959 5E                      pop esi
  230. :004D895A 5B                      pop ebx
  231. :004D895B 83C450                  add esp, 00000050
  232. :004D895E C21000                  ret 0010             <-- Exit back to Win95
  233.  
  234. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  235. |:004D894A(C), :004D8953(C)
  236. |
  237. :004D8961 33ED                    xor ebp, ebp         <-- Continues on with the game
  238. :004D8963 E8584BFCFF              call 0049D4C0
  239. :004D8968 E8534BFCFF              call 0049D4C0
  240. :004D896D E8DEEE0100              call 004F7850
  241. :004D8972 E8F9F50100              call 004F7F70
  242. :004D8977 55                      push ebp
  243.  
  244. * Reference To: USER32.GetSystemMetrics, Ord:012Ch
  245.                                   |
  246. :004D8978 8B1D3C561001            mov ebx, dword ptr [0110563C]
  247. :004D897E FFD3                    call ebx
  248. :004D8980 6A01                    push 00000001
  249. :004D8982 A344416600              mov dword ptr [00664144], eax
  250. :004D8987 FFD3                    call ebx
  251.  -- more program code --
  252.  
  253.     Alright, from here we can kill the call to the CD check routine by NOP'ing it out at 4D894C and
  254. changing the conditional jump to an unconditional jump so the game will always continue.  But look at the
  255. conditional jump at 4D894A!  It takes us right to the contiune section and jumps over the CD check in the
  256. process.  Great!, we will make use of it and change that conditional jump to an unconditional jump also.
  257. So let's go on to the other section of code that calls the "check for original CD" routine at 4D8C21 with
  258. some surrounding code:
  259.  
  260. :004D8C18 A1C0646500              mov eax, dword ptr [006564C0]
  261. :004D8C1D A804                    test al, 04
  262. :004D8C1F 7515                    jne 004D8C36         <-- Another conditional jump past it all
  263. :004D8C21 E87AF00100              call 004F7CA0        <-- Call the "insert CD" routine
  264. :004D8C26 85C0                    test eax, eax        <-- Check to see what came back in eax
  265. :004D8C28 750C                    jne 004D8C36         <-- Take this jump for good CD check
  266. :004D8C2A 33C0                    xor eax, eax         <-- Zero out eax
  267. :004D8C2C 5D                      pop ebp
  268. :004D8C2D 5F                      pop edi
  269. :004D8C2E 5E                      pop esi
  270. :004D8C2F 5B                      pop ebx
  271. :004D8C30 83C450                  add esp, 00000050
  272. :004D8C33 C21000                  ret 0010             <-- Exit back to Win95
  273.  
  274. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  275. |:004D8C1F(C), :004D8C28(C)
  276. |
  277. :004D8C36 C744241000000000        mov [esp+10], 00000000 <-- Continue with the game
  278. :004D8C3E 56                      push esi
  279. :004D8C3F 68007E4F00              push 004F7E00
  280.  
  281. * Reference To: USER32.EnumWindows, Ord:00C8h
  282.                                   |
  283. :004D8C44 FF1528561001            Call dword ptr [01105628]
  284. :004D8C4A 8B442410                mov eax, dword ptr [esp+10]
  285.  -- more program code --
  286.  
  287.     Nearly the same as the first section we examined and well make the same type of edit for this
  288. one also.  The program checks for CD once per gaming session, then sets a flag value at 6564C0 that
  289. tells rally the CD is present and already has been checked for.  Then as you play the game rally checks
  290. 6564C0 and if set correctly skips checking for the CD again.  Which is useful to us in removing the check
  291. from the game.  Instead of relying on the conditional jump to skip over the CD check, we'll change it to
  292. always jump over the CD check call.  Then NOP'ing out the call to the CD checking routine and forcing the
  293. following conditional jump is overkill, but that's ok I added it in anyways.  Now all you need to do is
  294. make the patch to the rally.exe file by version:
  295.  
  296. For the version off the CD, edit rally.exe
  297. =============================================================
  298. Search for: 75 15 E8 81 62 FF FF 85 C0 75 0C (offset 235,304)
  299. Change to : EB -- 90 90 90 90 90 -- -- EB --
  300.  
  301. Search for: 75 15 E8 B1 5F FF FF 85 C0 75 0C (offset 236,024)
  302. Change to : EB -- 90 90 90 90 90 -- -- EB --
  303.  
  304.  
  305. For the MMX Enhanced version 2.1, edit rally.exe
  306. =============================================================
  307. Search for: 75 15 E8 4F F3 01 00 85 C0 75 0C (offset 884,042)
  308. Change to : EB -- 90 90 90 90 90 -- -- EB --
  309.  
  310. Search for: 75 15 E8 7A F0 01 00 85 C0 75 0C (offset 884,767)
  311. Change to : EB -- 90 90 90 90 90 -- -- EB --
  312.  
  313.     Once again I helped guide you through another example of a CD check and showed you a way to defeat
  314. it.  The end result is a copy of Rally Championship on your hard drive that you can run without having to
  315. dig out the original game CD first.  Well, there you have it, Sega Rally is now FiX'ed
  316.  
  317. Static Vengeance
  318.